Part Number Hot Search : 
HC4046 K150E MAX19588 CS5253 00005 PA102 BYQ30EB HA122
Product Description
Full Text Search
 

To Download AN887 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN887/1100 1/12 AN887 application note microcontrollers made easy by microcontroller division applications what is a microcontroller? a few years ago, system control functions were implemented using logic components and were usually large, heavy boxes. later on, microprocessors were used and the entire con- troller could fit onto a small circuit board. as the process of miniaturization continued, all of the components needed for a controller were built right onto one chip . by only including the fea- tures specific to the task, cost is relatively low. a typical microcontroller has bit manipulation instructions, easy7 and direct access to i/o, and quick and efficient interrupt processing. therefore, a microcontroller is a highly integrated device which includes, on one chip, all or most of the parts needed to perform an application control function. microcontrollers come in many varieties. depending on the power and features that are needed, customers might choose a 4, 8, 16, or 32 bit microcontroller. figure 1. typical mcu block diagram rom ( r ead o nly m emory) rom is usually used to store program instructions. rom is the least expensive mean of storing a program in a microcontroller, especially for high volume manufacturing. rom ram cpu eeprom i/o port serial timer a / d converter interface executes program manages events contains program and data si gnal generati on event counting application timebase contains temporary data contai ns permanent data peri pheral i nterface analog data acquisition sends and recei ves data vr02101a 1
2/12 microcontrollers made easy flash flash is an electrically erasable and programmable memory. it can be used instead of rom to store program instructions and data. a key parameter of flash memory is its endurance or the number of times it can be erased or reprogrammed. depending on the technology used, flash endurance can be either 100 or 300,000 program/erase cycles. ram ( r andom a ccess m emory) during in the execution of a program, data have to be saved for later use. data are usually stored in ram. eeprom ( e lectrically e rasable p rogrammable r ead o nly m emory) there is another way to store data in a microcontroller: eeprom is used to store data that must be saved through a power down cycle. cpu ( c entral p rocessing u nit) it is the brain of the system that processes all data and their travel along the bus. for example, in order to execute a program, the cpu will read the first instruction from program memory. this instruction is decoded by the cpu and executed. at the completion of the execution of the instruction, the next instruction is fetched from memory and is executed. this procedure is repeated until the end of the program (or an endless loop) is found. figure 2. typical microcontroller block organization timers the timer or timing system makes it possible to measure and time external and internal events. the power of the timers varies greatly between different mcus. i / o (input / output) ports most microcontrollers have several digital i/o ports that are used to drive a led or get a key- board input. usually, a port consists of eight or less bits, usually programmable as either input or output bits. central processing unit ram eeprom data memory rom program memory input output timing system bus peripheral systems vr02101b 2
3/12 microcontrollers made easy serial interface serial interface are used to exchange data with the external world. many microcontrollers have both asynchronous and synchronous communications peripherals built in. usually, an asynchronous interface is called a serial communication interface ( sci or uart ) while the synchronous interface is called a serial peripheral interface ( spi ). a typical sci application is to connect a pc for debugging purpose while a typical spi application is to connect an ex- ternal eeprom. a synchronous bus includes a separate line for the clock signal which simplifies the transmitter and receiver but is more susceptible to noise when used over long distances. with an asyn- chronous bus the transmitter and receiver clocks are independent, and a resynchronization is performed for each byte at the start bit. figure 3. synchronous and asynchronous communication principles a/d converter converts an external analog signal (typically relative to voltage) into a digital representation. microcontrollers that have this feature can be used for instrumentation, environmental data logging, or any application that lives in an analog world. figure 4. a/d converter principle vr02101c synchronous asynchronous 0b bb b b1 clock bbb data clock + data b b start stop bb vr02101d analog 1 2 3 4 5 analog signal time 54 2 11 2 digital voltage a / d converter
4/12 microcontrollers made easy 1 typical microcontroller applications microcontrollers are frequently found in home appliances (microwave oven, refrigerators, tel- evision and vcrs, stereos), computers and computer equipment (laser printers, modems, disk drives), cars (engine control, diagnostics, climate control), environmental control (green- house, factory, home), instrumentation, aerospace, and thousands of other uses. in many items, more than one processor can be found. figure 5. typical mcu applications while microprocessors target the maximum processing performance, the purpose of micro- controllers is to implement a set of control function in the most cost effective way. although controlling a microwave oven with a pentium (tm) might seem an attractive idea, it can be easily accomplished with an st6. in a typical application, the mcu has to manage several tasks according to their priority or to the occurrence of external events (new command send by the keyboard, external temperature rise,...) figure 6. example of mcu task management. the ability to manage control tasks by hardware or by software is the main performance indi- cator for mcus. keyless tv set car radio telephone set monitor keyboard remote control battery charger dimmer switch remote meter dashboad front panel body controller vr02101e function keyboard scanning measure temperature change information display central mcu temperature
5/12 microcontrollers made easy example: the automotive market the automotive market is the most important single driving force in the microcontroller market, especially at it's high end. several microcontroller families were developed specifically for automotive applications and were subsequently modified to serve other embedded appli- cations. figure 7. mcu applications in automotive the automotive market is demanding in term of device performance and component reliability. electronics must operate under extreme temperatures and be able to withstand vibration , shock , and emi . the electronics must be reliable, because a failure that causes an accident can (and does) result in multi-million dollar lawsuits. reliability standards are high - but be- cause these electronics also compete in the consumer market - they have a low price tag. figure 8. mcu applications in todays and tomorrows home vr02101f trip computer car radio keyless entry fuel injection airbag window lift dashboard display seat belt fastener vr02101f vr02101g today's home tomorrow's home - tv set, vcr - cordless phone - washing machine - energy management - home automation - heating system - "green" refrigerator - vacuum cleaner - securi ty
6/12 microcontrollers made easy 2 additional microcontroller features 2.1 timers watchdog timer. a watchdog timer provides a means of graceful recovery from a system problem. this could be a program that goes into an endless loop, or a hardware problem that prevents the program from operating correctly. if the program fails to reset the watchdog at some predetermined interval, a hardware reset will be initiated. the bug may still exist, but at least the system has a way to recover. this is especially useful for unattended systems. auto reload timer. compared to a standard timer, this timer automatically reloads its counting value when the count is over, therefore sparing a waste of cpu resource. figure 9. standard timer and auto-reload timer principle pulse width modulator. often used as a digital-to-analog conversion technique. a pulse train is generated and regulated with a low-pass filter to generate a voltage proportional to the duty cycle. figure 10. pwm principle pulse accumulator. a pulse accumulator is an event counter. each pulse increments the pulse accumulator register, recording the number of times this event has occurred. input capture. input capture can measure external frequencies or time intervals by copying the value from a free running timer into the input capture register when an external event oc- curs. vr02101h timer load register clock cpu reload end of timer load register clock cpu reload end of count count standard timer auto reload timer vr02101i rc filter clock v time analog voltage pwm
7/12 microcontrollers made easy output compare. output compare can time an external event by sending a value stored in- side the output compare register. figure 11. input capture and output capture timer functions 2.2 digital signal processors (dsp) microcontrollers react to and control events, whereas dsps execute repetitive math-intensive algorithms. today many embedded applications require both types of processors, and semi- conductor manufacturers have responded by introducing microcontrollers with on-chip dsp capability and dsps with on-chip microcontrollers. the most basic thing a dsp will do is a macc (multiply and accumulate). the number of data bits a dsp can multiply and accumulate will determine the dynamic range (and there- fore the application). 2.3 analog and digital signals we live in an analog world where the information we see, hear, process, and exchange with each other, and with our mechanical and electronic systems, is always an analog quantity : pressure, temperature, voltage and current are always analog entities. they can be digitized for more efficient storage and transmission, but the interface (input and output) is almost al- ways analog. thus the essence of analog electronics lies in sensing continuously varying in- formation, converting it to digital and reshaping the digital data to an analog signal at the other end. mixed analog-digital devices are being used increasingly to integrate the complex func- tions of high-speed telecommunications, or the real-time data processing demanded by indus- trial control systems and automotive systems. vr02101j timer ic register clock value incoming event timer oc register clock value outgoi ng event input capture output compare
8/12 microcontrollers made easy figure 12. mixed a/d system example analog to digital conversion (a / d). converts an external analog signal (typically relative to voltage) and converts it to a digital representation. microcontrollers that have this feature can be used for instrumentation, environmental data logging, or any application that lives in an an- alog world. various types of a/d converters that can be found. comparator . one or more standard comparators can sometimes be placed on a microcon- troller die. these comparators operate much like standard comparators however the input and output signals are available on the microcontroller bus. digital to analog conversion (d/a) . this feature takes a digital number and converts it to a analog output. the number 50 would be changed to the analog output of (50 / 256 * 5 volts) = .9765625 v on a 8 bit / 5 volt system. vr02101k fan thermometer converter converter a / d d / a data processing digital analog data analog data
9/12 microcontrollers made easy 2.4 communication can & j1850 can (controller area network) is a multiplexed wiring scheme that was developed jointly by bosh and intel for wiring in automobiles. j1850 is the sae (society of automotive engineers) multiplexed automotive wiring standard that is currently in use in north america. the can specification seems to be the one that is being used in industrial control both in north american and europe. with lower cost microcontrollers that support can, can has a good potential to take off. figure 13. can principle i2c bus - inter-integrated circuit bus (philips) the i2c bus is a simple 2 wire serial interface developed by philips. it was developed for 8 bit applications and is widely used in consumer electronics, automotive and industrial applica- tions. in addition to microcontrollers, several peripherals also exist that support the i2c bus. the i2c bus is a two line, multi-master, multi-slave network interface with collision detection. up to 128 devices can exist on the network and they can be spread out over 10 meters. each node (microcontroller or peripheral) may initiate a message, and then transmit or receive data. the two lines of the network consist of the serial data line and the serial clock line. each node on the network has a unique address which accompanies any message passed between nodes. since only 2 wires are needed, it is easy to interconnect a number of devices. uart. a uart (universal asynchronous receiver transmitter) is a serial port adapter for asynchronous serial communications. usart. a usart (universal synchronous / asynchronous receiver transmitter) is a serial port adapter for either asynchronous or synchronous serial communications. communications using a usart are typically much faster (as much as 16 times) than with a uart. vr02101l gateway inter mot or abs / asr dashboard fuse box comfort radio, display navigation body window, lock seat, lamps air conditioner fast speed > 125 kb / s system slow speed < 125 kb / s slow speed system, phone
10/12 microcontrollers made easy 2.5 interrupts polling. polling is what you have to do if your microcontroller does not have interrupts or if what you want to do is not time critical. it is a software technique whereby the controller con- tinually asks a peripheral if it needs servicing. the peripheral sets a flag when it has data ready for transferring to the controller, which the controller notices on its next poll. several pe- ripherals can be polled in succession, with the controller jumping to different software routines, depending on which flags have been set. figure 14. polling versus interrupt interrupts. rather than have the microcontroller continually polling - that is, asking periph- erals (timers / uarts / a/ds / external components) whether they have any data available (and finding most of the time they do not), a more efficient method is to have the peripherals tell the controller when they have data ready. the controller can be carrying out its normal function, only responding to peripherals when there is data to respond to. on receipt of an in- terrupt, the controller suspends its current operation, identifies the interrupting peripheral, then jumps to the appropriate interrupt service routine. the advantage of interrupts, compared with polling, is the speed of response to external events and reduced software overhead (of con- tinually asking peripherals if they have any data ready). most microcontrollers have at least one external interrupt, which can be edge selectable (rising or falling) or level triggered. both systems have advantages. edge is not time sensitive, but it is susceptible to glitches. level must be held high (or low) for a specific duration (which can be a pain but is not susceptible to glitches). vr02101m task 1 polling loop task 3 task 2 event occurs polling loop polling loop process event task 1 task 3 task 2 event occurs interrupt process event save state restore state polling interrupt task 4 task 4
11/12 microcontrollers made easy 3 power supply issues in mcus since automotive applications have been the driving force behind most microcontrollers, and 5 volts was very easy to do in a car, most microcontrollers only supported 4.5 - 5.5 v opera- tion. in the recent past, as consumer goods were beginning to drive major segments of the mi- crocontroller market, and became portable and lightweight, the requirement for 3 volt (and lower) microcontrollers became urgent. 3 volts means 2 battery solution, lower voltage and longer battery life. most low voltage parts in the market today are simply 5 volt parts that were modified to operate at 3 volts (usually at a performance loss) . some micros being released now are designed from the ground up to operate properly at 3.0 (and lower) voltages, which offer a performance level comparable to 5 volt devices. but why are voltages going down on ics? there are a few interesting rules of thumb regarding transistors: 1) the amount of power they dissipate is proportional to their size. if you make a transistor half as big, it dissipates half as much power. 2) their propagation delay is proportional to their size. if you make a transistor half as big, it's twice as fast. 3) their cost is proportional to the square of their size. if you make them half as big, they cost one quarter as much. figure 15. transistor parameter scheme for years people have been using 5 volts to power integrated circuits. because the transistors were large, there was little danger damaging the transistor putting this voltage across it. how- ever, now that the transistors are getting so small, 5 volts would now destroy them. the only way around this is to start lowering the voltage. this is also why people are now using 3 (ac- tually 3.3) volt logic, and this will certainly lead to lower voltages in the next few years. vr02101n power speed cost supply voltage size transistor + - - +
12/12 microcontrollers made easy the present note which is for guidance only aims at providing customers with information regarding their products in order for them to save time. as a result, stmicroelectronics shall not be held liable for any direct, indirect or consequential damages with respect to any claims arising from the content of such a note and/or the use made by customers of the information contained herein in connexion with their products. information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publicati on are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics prod ucts are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroele ctronics. the st logo is a registered trademark of stmicroelectronics ? 2000 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - china - finland - france - germany - hong kong - india - italy - japan - malaysia - malta - morocco - sin gapore - spain sweden - switzerland - united kingdom - u.s.a. http://www.st.com


▲Up To Search▲   

 
Price & Availability of AN887

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X